#pragma once

#include "UMLAssociationOrConnectorOrLinkShape.h"


namespace uml {

UMLAssociationOrConnectorOrLinkShape::UMLAssociationOrConnectorOrLinkShape(const QString& umlType)
    : UMLShape(umlType) {}

void UMLAssociationOrConnectorOrLinkShape::fromJson(const QJsonObject& json, QStringList& errorList) {
    if (json.isEmpty()) {
        return;
    }

    UMLShape::fromJson(json, errorList);
    kind_ = (UMLAssociationOrConnectorOrLinkShapeKind)json.value("kind").toInt((int)kind_);
}

void UMLAssociationOrConnectorOrLinkShape::toJson(QJsonObject& json) {
    UMLShape::toJson(json);
    json.insert("kind", (int)kind_);
}

/// <summary>
/// kind getter
/// </summary>
UMLAssociationOrConnectorOrLinkShapeKind UMLAssociationOrConnectorOrLinkShape::kind() const {
    return kind_;
}

/// <summary>
/// kind setter
/// </summary>
void UMLAssociationOrConnectorOrLinkShape::setKind(UMLAssociationOrConnectorOrLinkShapeKind value) {
    kind_ = value;
}

} // namespace uml
